package com.retail.product.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 商品图片实体类
 *
 * @author retail
 * @since 2024-09-25
 */
@Data
@TableName("product_image")
@Schema(description = "商品图片实体")
public class ProductImage {

    /**
     * 图片ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "图片ID")
    private Long id;

    /**
     * 商品ID
     */
    @TableField("product_id")
    @Schema(description = "商品ID", example = "1")
    private Long productId;

    /**
     * 图片URL
     */
    @TableField("image_url")
    @Schema(description = "图片URL", example = "http://example.com/image1.jpg")
    private String imageUrl;

    /**
     * 图片类型：1-主图，2-详情图
     */
    @TableField("image_type")
    @Schema(description = "图片类型：1-主图，2-详情图", example = "1")
    private Integer imageType;

    /**
     * 排序
     */
    @TableField("sort_order")
    @Schema(description = "排序", example = "0")
    private Integer sortOrder;

    /**
     * 创建时间
     */
    @TableField("created_time")
    @Schema(description = "创建时间")
    private LocalDateTime createdTime;
}